package com.hzlx.badGoods.feign.fallback;


import com.hzlx.MesBadGoodsDto;
import com.hzlx.ProductionProductsDto;
import com.hzlx.ResultDto;
import com.hzlx.badGoods.feign.productionService;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class productionServiceFallbackFactory implements FallbackFactory<productionService> {
    @Override
    public productionService create(Throwable cause) {
        return new productionService(){
            @Override
            public ResultDto<String> deleteByProductIdByDo(MesBadGoodsDto mesBadGoodsDto) {

                return  ResultDto.<String>builder().msg("远程调用删除次品失败"+cause.getMessage()).build();
            }

            @Override
            public ResultDto<String> addBadGoods(ProductionProductsDto productionProductsDto) {
                return null;
            }
        };
    }
}
